import com.sun.xml.internal.fastinfoset.util.StringArray

/**
 * Created by Administrator on 2019/10/18.
 */
class HighFunc {

}

fun sum1(a : Int , b : Int , c : (var1 : Int, var2 : Int) -> Int) : Int{
    return a + c.invoke(a, b)
}

fun main(args : Array<String>){
    println(sum1(1,2){a, b -> a * b})
    println(tc(2,4))

    println(closePkg1(2).invoke())
}

var td : (Int, Int) -> Int = {a , b -> a + b}

var tc = {a : Int, b : Int -> a * b}

fun closePkg1(a : Int) : ()->Int{
    val b = a + 20
    return fun():Int{
        return a * b
    }
}